package com.john.bms.model.system.menu;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @Author:张家小帅哥
 * @Date:2020/6/6
 * @Version:1.0
 * @Description:TODO
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SysMenu implements Serializable {

    @TableId(type = IdType.INPUT)
    private Integer id;

    /**
     * 菜单名称
     */
    @NotNull(message = "title cannot be null")
    private String title;

    /**
     * 路径地址
     */
    private String path;

    private String name;

    /**
     * 菜单图标
     */
    private String icon;

    /**
     * 父类id
     */
    private Integer parentId;

    private String shiroKey;

    /**
     * 是否显示0显示1不显示
     */
    private Integer hidden;

    /**
     * 排序
     */
    private Integer sort;

    /**
     * 组件类型
     */
    private String component;

    /**
     * 菜单类型
     */
    private String type;

    //@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    //@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    //数据库不存在这个字段
    @TableField(exist = false)
    private int hasChildren;

    private static final long serialVersionUID = 1L;

}
